using System;
using System.Collections.Generic;
using System.Text;
using SharpCast;
using System.Threading;

namespace TestSharpCast
{
    class Program
    {
        private static SongsDB.SDBApplication mm;

        static void Main(string[] args)
        {
            Console.WriteLine("SharpCast v0.1");

            Channel cast = new Channel("C:\\Documents and Settings\\Michael\\Desktop\\science.rss");
            Console.WriteLine(cast.title);
            Console.WriteLine(cast.link);


            Directory d = new Directory();
            d.channels.Add(cast);

            d.save("test.opml");

            d.saveCache("test.cache");

            d = Directory.loadCache("test.cache");

            Console.WriteLine("Categories:");
            foreach (String category in cast.categories)
            {
                Console.WriteLine("\t" + category);
            }

            //DownloadHandel handel = cast.episodes[0].download("download.mp3");
            //while (handel.state != DownloadHandel.State.finished)
            //{
            //    Console.Out.WriteLine("Downloading: " + handel.downloaded + " of " + handel.contentLength + " bytes");
            //    Thread.Sleep(500);
            //}


            Console.ReadLine();

            cast.update();
        }
    }
}
